<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- 6，打印三角形
        7，打印梯形 -->
    <input type="button" value="三角形" onclick="sanJiaoXin()">
    <input type="button" value="梯形" onclick="tixin()">
    <input type="button" value="等腰梯形" onclick="dengYao()">
    <input type="button" value="等腰三角形"onclick="dengYaoSan()" >
    <script>
        function sanJiaoXin() {
            for (var i = 0; i < 5; i++) {
                for (j = 0; j < i + 1; j++) {
                    document.write("@")
                }
                document.write("<br/>")
            }
        }
        function tixin() {
            for (var i = 0; i < 5; i++) {
                for (j = 0; j < i + 2; j++) {
                    document.write("@")
                }
                document.write("<br/>")
            }
        }
        function dengYaoSan(){
            for(var i=0;i<4;i++){
                for(var j=0;j<3-i;j++){
                    document.write("&emsp;")
                }
                for(var k=0;k<2*i+1;k++){
                    document.write(`☆ `);
                }
                document.write("<br/>")
            }
        }
        function dengYao(){
            for(var i=0;i<4;i++){
                for(var j=0;j<4-i;j++){
                    document.write("&emsp;")
                }
                for(var k=0;k<2*i+2;k++){
                    document.write(`☆ `);
                }
                document.write("<br/>")
            }
        }
    </script>
</body>

</html>